#include <iostream>
#include <string>

using namespace std;
const int N = 100010;

int n;
char a,b;
int c,d;
double res;
double do_operation(double res, char op, int num)
{

    if(op == '+') return res + num;
    else if(op == '-') return res - num;
    else if(op == '*') return res *num;
    else if(op == '/') return res / num;
    return res;
}
int main(){
    cin >> n;
    while(n -- )
    {
        cin >>a >> c >> b >> d;


        res= max(do_operation(res, a,c), do_operation(res, b,d));
    }
    cout << res;

}